package com.dfrz.ch06.tackTeacher;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * 程序功能：输入母串与子串，去除母串中的所有子串
 */
public class ExString08 {

	/**
	 * 主函数
	 * @param args
	 * @throws IOException
	 */

	public static void main(String[] args) throws IOException{

////		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
//		while(true){
//			System.out.print("Input a text:");
//			String text = buf.readLine();
//			System.out.print("Input a word:");
//			String word = buf.readLine();
//			String result = removeSubstring(text,word);
//			System.out.print("Result is:" + result);
//			System.out.print("\t\n\t\n");
//		}

		Scanner scanner=new Scanner(System.in);
		System.out.print("Input a text:");
		String text=scanner.nextLine();
		System.out.print("Input a word:");
		String word=scanner.nextLine();

		while (text.contains(word)){
			text=text.replace(word,"");
			System.out.println(text);
		}



	}

}
